/**
 * 路由器对象模块
 */
import Vue from 'vue';
import VueRouter from "vue-router";
// import MSite from '../pages/MSite/MSite.vue';
// import Search from '../pages/Search/Search.vue';
// import Order from '../pages/Order/Order.vue';
// import Profile from '../pages/Profile/Profile.vue';
// import Login from '../pages/Login/Login.vue';
import Shop from '../pages/Shop/Shop.vue';
import ShopGoods from '../pages/Shop/ShopGoods/ShopGoods.vue';
import ShopRatings from '../pages/Shop/ShopRatings/ShopRatings.vue';
import ShopInfo from '../pages/Shop/ShopInfo/ShopInfo.vue';

// 声明使用插件
Vue.use(VueRouter);

export default new VueRouter({
    //所有路由
    routes: [
        {
            path: '/msite',
            component: () => import("../pages/MSite/MSite.vue"),
            meta: {
                showFooter: true
            }
        },
        {
            path: '/search',
            component: () => import("../pages/Search/Search.vue"),
            meta: {
                showFooter: true
            }
        },
        {
            path: '/order',
            component: () => import("../pages/Order/Order.vue"),
            meta: {
                showFooter: true
            }
        },
        {
            path: '/profile',
            component: () => import("../pages/Profile/Profile.vue"),
            meta: {
                showFooter: true
            }
        },
        {
            path: "/login",
            component: () => import("../pages/Login/Login.vue")
        },
        {
            path: "/shop",
            component: Shop,
            children: [
                {
                    path: "/shop/goods",
                    component: ShopGoods
                },
                {
                    path: "/shop/ratings",
                    component: ShopRatings
                },
                {
                    path: "/shop/info",
                    component: ShopInfo
                },
                {
                    path: '',
                    redirect: '/shop/goods'
                }
            ]
        },
        {
            path: '/',
            redirect: '/msite'
        }
    ]
})


